<?php

class dbaVariations {

  function dbaVariations (&$dba){
    $this->dba = &$dba;
  }

  function add ($art_id,$orderno,$name,$descr,$amount){
    return $this->dba->query("insert into ".$this->dba->tableforwarder."_shopVariation (art_id,orderno,name,descr,amount) values ('$art_id','$orderno','$name','$descr','$amount');");
  }

  function del ($id){
    return $this->dba->query("delete from ".$this->dba->tableforwarder."_shopVariation where id='$id';");
  }

  function getByArticle ($art_id){
    $this->dba->query("select * from ".$this->dba->tableforwarder."_shopVariation where art_id = '$art_id' order by name;");
    return $this->dba->fetch_rows_array();
  }

  function getByID ($id){
    $this->dba->query("select * from ".$this->dba->tableforwarder."_shopVariation where id = '$id';");
    return $this->dba->fetch_row_array();
  }

}

?>
